package com.syh.jn.scm.infrastructure.repository.model.purchase;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 采购退货单
 */
@Data
@Builder
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "T_PUR_PURCHASE_RETURN_ORDER")
@EqualsAndHashCode(callSuper = true)
public class PurchaseReturnOrderModel extends SuperBusinessModel {
    /**
     * 采购退货订单编号
     */
    @Column(name = "RETURN_CODE", columnDefinition = "varchar(100) COMMENT '采购退货订单编号'")
    private String returnCode;
    /**
     * 第三方单号
     */
    @Column(name = "EXT_CODE", columnDefinition = "varchar(100) COMMENT '第三方单号'")
    private String extCode;
    /**
     * 对应采购订单id
     */
    @Column(name = "PURCHASE_ORDER_ID", columnDefinition = "bigint COMMENT '对应采购订单id'")
    private Long purchaseOrderId;
    /**
     * 上游供应商id
     */
    @Column(name = "UP_STREAM_COMPANY_ID", columnDefinition = "bigint COMMENT '上游供应商id'")
    private Long upStreamCompanyId;
    /**
     * 采购退货订单状态(0：待确认 1：已确认 2：挂起 3:已生成对账单 -1：已取消)
     */
    @Column(name = "RETURN_ORD_STATE", columnDefinition = "smallint COMMENT '采购订单状态(0：待确认 1：已确认 2：挂起 3:已生成对账单 -1：已取消 )'")
    private Short returnOrdState;
    /**
     * 字典id(退货原因)
     */
    @Column(name = "RETURN_REASON_ID", columnDefinition = "bigint COMMENT '字典id(退货原因)'")
    private Long returnReasonId;
    /**
     * 收货人姓名
     */
    @Column(name = "DELI_NAME", columnDefinition = "varchar(50) COMMENT '收货人姓名'")
    private String deliName;
    /**
     * 收货人联系电话
     */
    @Column(name = "DELI_TEL", columnDefinition = "varchar(50) COMMENT '收货人联系电话'")
    private String deliTel;
    /**
     * 运费金额
     */
    @Column(name = "TOTAL_FREIGHT", columnDefinition = "decimal(19,2) COMMENT '运费金额'")
    private BigDecimal totalFreight;
    /**
     * 收货地区编码
     */
    @Column(name = "DELI_AREA_CODE", columnDefinition = "varchar(50) COMMENT '收货地区编码'")
    private String deliAreaCode;
    /**
     * 收货地址省 市 区
     */
    @Column(name = "DELI_AREA", columnDefinition = "varchar(300) COMMENT '收货地址省 市 区 使用[广东省,广州市,海珠区]格式保存'")
    private String deliArea;
    /**
     * 收货人详细地址
     */
    @Column(name = "DELI_ADDRESS", columnDefinition = "varchar(300) COMMENT '收货人详细地址'")
    private String deliAddress;
    /**
     * 发货地区编码
     */
    @Column(name = "RET_DELI_AREA_CODE", columnDefinition = "varchar(50) COMMENT '发货地区编码'")
    private String retDeliAreaCode;
    /**
     * 发货地址省 市 区
     */
    @Column(name = "RET_DELI_AREA", columnDefinition = "varchar(300) COMMENT '发货地址省 市 区'")
    private String retDeliArea;
    /**
     * 发货人详细地址
     */
    @Column(name = "RET_DELI_ADDRESS", columnDefinition = "varchar(300) COMMENT '发货人详细地址'")
    private String retDeliAddress;
    /**
     * 备注
     */
    @Column(name = "REMARK", columnDefinition = "varchar(500) COMMENT '备注'")
    private String remark;
    /**
     * 录单人员id
     */
    @Column(name = "OPERATOR_ID", columnDefinition = "bigint COMMENT '录单人员id'")
    private Long operatorId;
    /**
     * 物流生成状态(0：未生成物流单 1：部分生成物流单2：完成生成物流单)
     */
    @Column(name = "GENERATED_STATE", columnDefinition = "smallint COMMENT '物流生成状态(0：未生成物流单 1：部分生成物流单2：完成生成物流单)'")
    private Short generatedState;
    /**
     * 发货状态(0：未发货 1：部分发货 2：完成发货)
     */
    @Column(name = "DELIVERY_STATE", columnDefinition = "smallint COMMENT '发货状态(0：未发货 1：部分发货 2：完成发货)'")
    private Short deliveryState;
    /**
     * 签收状态(0：未签收 1：部分签收 2：完成签收)
     */
    @Column(name = "COLLECT_STATE", columnDefinition = "smallint COMMENT '签收状态(0：未签收 1：部分签收 2：完成签收)'")
    private Short collectState;
    /**
     * 退货订单总额
     */
    @Column(name = "RETURN_TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '退货总额'")
    private BigDecimal returnTotalAmount;
    /**
     * 退货订单商品总额
     */
    @Column(name = "RETURN_TOTAL_GOODS_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '退货订单商品总额'")
    private BigDecimal returnTotalGoodsAmount;
    /**
     * 退货出库总额
     */
    @Column(name = "RETURN_TOTAL_OUT_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '退货出库总额'")
    private BigDecimal returnTotalOutAmount;
    /**
     * 退货出库商品总额
     */
    @Column(name = "RETURN_TOTAL_OUT_GOODS_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '退货出库商品总额'")
    private BigDecimal returnTotalOutGoodsAmount;
    /**
     * 退货签收总额
     */
    @Column(name = "RETURN_TOTAL_IN_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '退货签收总额'")
    private BigDecimal returnTotalInAmount;
    /**
     * 退货签收商品总额
     */
    @Column(name = "RETURN_TOTAL_IN_GOODS_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '退货签收商品总额'")
    private BigDecimal returnTotalInGoodsAmount;
    /**
     * 优惠减免
     */
    @Column(name = "DISCOUNT", columnDefinition = "decimal(19,2) COMMENT '优惠减免'")
    private BigDecimal discount;
    /**
     * 对账单id
     */
    @Column(name = "STATEMENT_ID", columnDefinition = "bigint COMMENT '对账单id'")
    private Long statementId;
    /**
     * 创建日期
     */
    @Column(name = "CREATE_TIME_STAMP", columnDefinition = "bigint COMMENT '创建日期'")
    private Long createTimeStamp;
    /**
     * 最后修改日期
     */
    @Column(name = "LAST_UPDATE_TIME_STAMP", columnDefinition = "bigint COMMENT '最后修改日期'")
    private Long lastUpdateTimeStamp;
    /**
     * 录单日期
     */
    @Column(name = "INPUT_DATE_TIMESTAMP", columnDefinition = "bigint COMMENT '录单日期'")
    private Long inputDateTimestamp;
    /**
     * 发货时间(出库)
     */
    @Column(name = "DELIVERY_TIMESTAMP", columnDefinition = "bigint COMMENT '发货时间(出库)'")
    private Long deliveryTimestamp;
    /**
     * 收货时间
     */
    @Column(name = "RECEIPT_TIMESTAMP", columnDefinition = "bigint COMMENT '收货时间'")
    private Long receiptTimestamp;
    /**
     * 我方单据图片
     */
    @Column(name = "MAIN_SRC_IMAGES", columnDefinition = "varchar(1000) COMMENT '我方单据图片'")
    private String mainSrcImages;
    /**
     * 对方单据图片
     */
    @Column(name = "SECOND_SRC_IMAGES", columnDefinition = "varchar(1000) COMMENT '对方单据图片'")
    private String secondSrcImages;
    /**
     * 是否已生成记录(库存记录、应收付记录等)
     */
    @Column(name = "HAVE_RECORD", columnDefinition = "smallint COMMENT '是否已生成记录 0:未生成  1：已生成'")
    private Short haveRecord;
}
